<?php
namespace app\index\controller;
use app\index\model\News;
use app\index\service\CompanyService;
use app\index\service\ConsultService;
use app\index\service\NewsService;
use app\index\utils\ResultUtil;
use think\Controller;

/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/4/22
 * Time: 下午7:48
 */
class Index extends BaseController
{
    public function index(){
        $rec_order_list = ConsultService::getIndexRecList();
        $this->assign("rec_order_list",$rec_order_list);
        $rec_company_list = CompanyService::getIndexCompanyList();
        $this->assign("rec_company_list",$rec_company_list);
        $rec_news_list = NewsService::getIndexRecNewsList(4);
        $this->assign("rec_news_list",$rec_news_list);
        return $this->fetch("index");
    }
    public function test(){
        $last_news = News::getRecestOne();
        $create_time = str_replace('+00:00', 'T', gmdate('c', strtotime($last_news['create_time'])));
        $create_time =  substr($create_time,0,strlen($create_time)-1);
        var_dump($create_time);die();
    }
}